//停车记录 - 静态 路由
import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
import { ResultTable } from "./result/result_table";

const basePath = "system/menu";

type Result = {
  success: boolean;
  data?: Array<any>;
  message?: string;
};

//菜单列表
export const getMenuList = (data?: object) => {
  return http.request<ResultTable>("post", baseUrlApi(basePath + ""), {
    data
  });
};

//添加菜单
export const addMenu = (data?: object) => {
  return http.request<ResultTable>("post", baseUrlApi(basePath + "/add"), {
    data
  });
};

//添加菜单
export const updateMenu = (data?: object) => {
  return http.request<ResultTable>("post", baseUrlApi(basePath + "/update"), {
    data
  });
};

//添加菜单
export const deleteMenu = (data?: object) => {
  return http.request<ResultTable>("post", baseUrlApi(basePath + "/delete"), {
    data
  });
};

//角色列表
export const getRoleMenu = (data?: object) => {
  return http.request<Result>("get", baseUrlApi(basePath + "/all"));
};

//角色列表
export const getRoleMenuIds = (data?: object) => {
  return http.request<Result>("post", baseUrlApi(basePath) + "/my", {
    data
  });
};
